<?php

class Admin_Form_Pointbassin extends Zend_Form
{
    public function __construct($options = null)
    {
        parent::__construct($options);
        $this->setName('espece');

        //$idespece = new Zend_Form_Element_Hidden('idespece');

        $latitude = new Zend_Form_Element_Text('latitude');
        $latitude->setLabel('Latitude')
        ->setRequired(true)
        ->addFilter('StripTags')
        ->addFilter('StringTrim')
        ->addValidator('NotEmpty');
        
        $longitude = new Zend_Form_Element_Text('longitude');
        $longitude->setLabel('Longitude')
        ->setRequired(true)
        ->addFilter('StripTags')
        ->addFilter('StringTrim')
        ->addValidator('NotEmpty');
        
      $bassin = new Zend_Form_Element_Select('bassin');
		$bassin->setLabel('Bassin')
         ->setRequired(true)
         ->addFilter('StripTags')
         ->addFilter('StringTrim')
         ->addValidator('NotEmpty');
 
		$table = new Admin_Model_DbTable_Bassinderetention();
		foreach ($table->fetchAll() as $c) {
	    	$bassin->addMultiOption($c->idbassinderetention, $c->nombassin);
		}
        
    $pointbassin_idpointbassin_pred = new Zend_Form_Element_Select('pointbassin_idpointbassin_pred');
		$pointbassin_idpointbassin_pred->setLabel('Point precedent')
         ->setRequired(true)
         ->addFilter('StripTags')
         ->addFilter('StringTrim')
         ->addValidator('NotEmpty');
 
		$table = new Admin_Model_DbTable_Pointbassin();
		foreach ($table->fetchAll() as $c) {
	    	$pointbassin_idpointbassin_pred->addMultiOption($c->idpointbassin, $c->latitude.'--'.$c->longitude);
		}

        

        
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setAttrib('id', 'submitbutton');
        
    
        $this->addElements(array($latitude,$longitude,$bassin,$pointbassin_idpointbassin_pred,$submit));
    }
    
    
    
   
}